<template>
	<scroll-view class="view-back">
		<uni-collapse v-model="value">
			<uni-collapse-item  :title="item.name" v-for="(item,index) in listArr" :key="index">
				<view @click="clicklistAction(index,ind)" v-for="(value,ind) in item.list" :key="ind"
					:class="[selectRow == index && selectcell == ind ? 'slot-box slot-box1':'slot-box']">{{value.name}}
				</view>
			</uni-collapse-item>
		</uni-collapse>
	</scroll-view>
</template>

<script>
	export default {
		name: 'leftSelect',
		data() {
			return {
				value:['0'],
				selectRow: 0,
				selectcell: 0,

				"listArr": [{
						"name": '咨询管理',
						"list": [{
							"name": '模板库'
						}, {
							"name": '律师管理'
						}, {
							"name": '参数配置'
						}, {
							"name": '冲突管理'
						}, {
							"name": '其他配置'
						}]
					},
					{
						"name": '商品管理',
						"list": [{
							"name": '商品管理'
						},]
					},
					{
						"name": '基础管理',
						"list": [{
							"name": 'banner管理'
						}, {
							"name": '微页面管理'
						}, {
							"name": '关于我们'
						}, {
							"name": '用户留言'
						}, {
							"name": '消息通知'
						}]
					},
					{
						"name": '用户列表',
						"list": [{
							"name": '用户列表'
						}]
					},
					{
						"name": '订单与服务',
						"list": [{
							"name": '订单列表'
						}, {
							"name": '服务权益'
						}]
					},
					{
						"name": '系统设置',
						"list": [ {
							"name": '角色权限管理'
						}]
					}
				]
			}
		},
		onLoad() {

		},
		methods: {
			clicklistAction(index, ind) {
				this.selectRow = index;
				this.selectcell = ind;
				console.log(this.selectRow,this.selectcell)
				this.$emit('clickleftAction', {
					'selectRow': this.selectRow,
					'selectcell': this.selectcell
				})
			}
		},
	}
</script>

<style lang="scss" scoped>
	.content {
		margin-left: 20px;
	}

	.uni-list-item__container {
		background-color: red;
	}

	.slot-box {
		font-size: 14px;
		color: #888;
		padding-left: 30px;
		background-color: white;
		width: 100%;
		height: 40px;
		border-top: 1px solid #eee;
		display: flex;
		align-items: center;
		cursor: pointer;
	}

	.slot-box1 {
		background-color: #eee;
	}
</style>
